import typeInfo from "../action";
function numReducer(state = { num: 10 }, action) {
  //state表示数据  action表示 描述对象的操作
  //console.log(action);
  switch(action.type){
    case typeInfo.ADDNUM:
        return  {num:state.num+action.payload}
    default:
        return state;
  }
}
export const  addNum = (payload)=>{
    return  {
        type:typeInfo.ADDNUM,
        payload
    }
}
export  default  numReducer;